package com.cms.recursoshumanos.object;

import com.cms.recursoshumanos.utilities.Tool;

import net.rim.device.api.system.Bitmap;
import net.rim.device.api.util.Persistable;

public class CustomPersistableBitmap  implements Persistable
{
	
	private byte[] arreglo_bytes_imagen;
	
	public CustomPersistableBitmap()
	{
	}
	public void setByteArray(byte[] array)
	{
		this.arreglo_bytes_imagen = array;
	}
	public byte[] getByteArray()
	{
		return this.arreglo_bytes_imagen;
	}
	public Bitmap getBitmap()
	{
		if (arreglo_bytes_imagen == null)
		{
			return null;
		}
		else
		{
			return Tool.getInstance().getBitmapFromBytes(arreglo_bytes_imagen);
		}
	}
	public void setBitmap(Bitmap bitmap)
	{
		if (bitmap == null)
		{
			this.arreglo_bytes_imagen = null;
		}
		else
		{
			this.arreglo_bytes_imagen = Tool.getInstance().getBytesFromBitmap(bitmap);
		}
	}
	
	
	
}
